<template>
  <PageWrapper>
    <Description class="desc-card" @register="register" />
  </PageWrapper>
</template>
<script setup lang="ts">
  import { PageWrapper } from '@/components/Page';
  import { Description, DescItem, useDescription } from '@/components/Description/index';

  const mockData: any = {
    username: 'test',
    nickName: 'VB',
    age: 123,
    phone: '15695909xxx',
    email: '190848757@qq.com',
    addr: '厦门市思明区',
    sex: '男',
    certy: '3504256199xxxxxxxxx',
    tag: 'orange',
  };
  const schema: DescItem[] = [
    {
      field: 'username',
      label: '用户名',
      span: 12,
    },
    {
      field: 'nickName',
      label: '昵称',
      span: 12,
      render: (curVal, data) => {
        return `${data.username}-${curVal}`;
      },
    },
    {
      field: 'phone',
      label: '联系电话',
      span: 12,
    },
    {
      field: 'email',
      label: '邮箱',
      span: 12,
    },
    {
      field: 'addr',
      span: 24,
      label: '地址',
    },
  ];
  const [register] = useDescription({
    title: '我是标题',
    data: mockData,
    column: 24,
    schema: schema,
  });
</script>
<style scoped lang="less">
  @import '/@/assets/styles/common-detail.less';
</style>
